<?php

use Jialeo\LaravelSchemaExtend\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class RepairUserCertOcrs extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('repair_user_cert_ocrs', function (Blueprint $table) {
            $table->charset = 'utf8';
            $table->collation = 'utf8_general_ci';
            $table->comment = '用户身份证修复表';
            $table->increments('id');
            $table->unsignedInteger('user_id')->comment('用户id')->index();
            $table->text('id_card_front')->comment('身份证正面url');
            $table->text('id_card_back')->comment('身份证反面url');
            $table->text('hand_cert')->comment('手持身份证url');
            $table->string('name')->comment('姓名');
            $table->string('num')->comment('身份证号');
            $table->string('domicile_address')->comment('户籍所在地');
            $table->string('issuing_authority')->comment('签发机关');
            $table->unsignedInteger('issue_gov_code')->comment('发证机关代码');
            $table->date('valid_date_begin')->comment('有效期开始');
            $table->char('valid_date_end',15)->comment('有效期结束');
            $table->string('upload')->nullable()->comment('已上传到FTP的标识');
            $table->tinyInteger('is_valid')->default(1)->comment('是否有效1有效0无效');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('repair_user_cert_ocrs');
    }
}
